/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Practica5.practica;

import Practica5.util.Vertex;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author dinamica
 */
public class MyVertex<E> extends Vertex<E>{
    
    private List<Vertex<E>> neighbours;
    private int distancia;
    private Vertex<E> padre;
    private int ingrado;
    private int exgrado;

    public MyVertex(E element, int index) {
        super(element, index);
        neighbours = new ArrayList<>();
        distancia = Integer.MAX_VALUE;
        padre = null;
        ingrado = 0;
        exgrado = 0;
    }

    public MyVertex(E element) {
        super(element);
        neighbours = new ArrayList<>();
        distancia = Integer.MAX_VALUE;
        padre = null;
        ingrado = 0;
        exgrado = 0;
    }

    public MyVertex() {
        super();
        neighbours = new ArrayList<>();
        distancia = Integer.MAX_VALUE;
        padre = null;
        ingrado = 0;
        exgrado = 0;
    }
    
    

    @Override
    public List<Vertex<E>> getNeighboursList() {
        return neighbours;
    }

    @Override
    public Vertex<E> getNeighbour(int i) {
        return neighbours.get(i);
    }

    @Override
    public void addNeighbours(List<Vertex<E>> vs) {
        for(Vertex v: vs){
            addNeighbour(v);
        }
    }

    @Override
    public void addSymmetricNeighbours(List<Vertex<E>> vs) {
        for(Vertex v: vs){
            addSymmetricNeighbours(vs);
        }
        
    }

    @Override
    public void addNeighbour(Vertex<E> v) {
        neighbours.add(v);
    }

    @Override
    public void addSymmetricNeighbour(Vertex<E> v) {
        addNeighbour(v);
        v.addNeighbour(this);
    }

    @Override
    public int grade() {
        return neighbours.size();
    }

    public int getDistancia() {
        return distancia;
    }

    public void setDistancia(int distancia) {
        this.distancia = distancia;
    }

    public Vertex<E> getPadre() {
        return padre;
    }

    public void setPadre(Vertex<E> padre) {
        this.padre = padre;
    }

    public int getExgrado() {
        return exgrado;
    }

    public void setExgrado(int exgrado) {
        this.exgrado = exgrado;
    }

    public int getIngrado() {
        return ingrado;
    }

    public void setIngrado(int ingrado) {
        this.ingrado = ingrado;
    }
    
       
    
}
